package com.cj.oss.controller;

import com.cj.commonutils.R;
import com.cj.oss.service.OssService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @author cj
 * @date 2023/3/23 20:23
 * @description
 */
@RestController
@RequestMapping("/eduoss/fileoss")
//@CrossOrigin
public class OssController {

    @Resource
    private OssService ossService;
    @PostMapping
    public R updateOssFile(MultipartFile file) {

        String url = ossService.updateFileAvatar(file);

        return R.ok().data("url",url);
    }
}
